<?php
class Logout extends CI_Controller {

    function __construct() {
        parent::__construct();
        $this->load->library('session');
        $this->load->helper('url');
        if (file_exists('application/controllers/install.php'))
            redirect('install');
    }

    function index() {
        if ($this->session->userdata['login']) {
            $this->session->sess_destroy();     // destroy the session
            redirect('poster_admin/login');
        } else {
            redirect('poster_admin/login');
        }

    }
}